import { createRouter, createWebHistory } from 'vue-router';
import LoginPage from '@/components/LoginPage.vue';
import SpiderPage from '@/components/SpiderPage.vue';
import AnalysisPage from '@/components/AnalysisView.vue';
import GeneratePage from '@/components/GeneratePage.vue';
import Test_G from '@/components/Test/Test_G.vue';
import Test_G2 from '@/components/Test/Test_G2.vue';
import DashboardPage from '@/components/DashboardView.vue';

const routes = [
    {
        path: '/login',
        component: LoginPage,
    },
    {
        path: '/spider',
        component: SpiderPage,
    },
    {
        path: '/analysis',
        component: AnalysisPage,
    },
    {
        path: '/dashboard',
        component: DashboardPage,
    },
    {
        path: '/generate',
        component: GeneratePage,
    },
    {
        path: '/test_g',
        component: Test_G,
    },
    {
        path: '/test_g2',
        component: Test_G2,
    },
    {
        path: '/:pathMatch(.*)*', // 默认路由，匹配所有未定义的路由
        redirect: '/login', // 跳转到登录界面
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;